/**
* @program: src
*
* @description:
*
* @author: Mr.chen
*
* @create: 2022-04-11 15:47
**/
package logic

import (
	"context"
	"do_demo/srv/app/logic/api/internal/svc"
	"do_demo/srv/app/logic/api/internal/types"
	pb "do_demo/srv/proto/logic"
	"github.com/gin-gonic/gin"
	"github.com/jinzhu/copier"
	"do_demo/srv/common/core/logx"
)

type TestSrvLogic struct {
	logx.Logger
	svcCtx *svc.ServiceContext
	ctx    context.Context
}

func NewTestSrvLogic(ctx context.Context,svcCtx *svc.ServiceContext) *TestSrvLogic {
	return &TestSrvLogic{
		Logger: logx.WithContext(ctx),
		svcCtx: svcCtx,
		ctx:    ctx,
	}
}
// TestSrv http端的逻辑处理
func (l *TestSrvLogic) TestSrv(c *gin.Context,req types.Arg) (resp *types.TestSrvResp,err error) {
	// todo: add your logic here and delete this line
	loginResp, err := l.svcCtx.LogicRpc.TestSrv(l.ctx, &pb.TestSrvReq{})
	if err != nil {
		return nil, err
	}
	resp = &types.TestSrvResp{}
	_ = copier.Copy(resp, loginResp)
	return resp, nil
}

